package Ch13;

import java.util.Calendar;
import java.util.GregorianCalendar;

public class Time2 {

	public static void main(String[] args) {
		Calendar cal1 = Calendar.getInstance();
		System.out.println(cal1);
		Calendar cal2 = new GregorianCalendar();
		System.out.println(cal2);
		
		int year = cal1.get(Calendar.YEAR);
		System.out.println(year);
		
		int month = cal1.get(Calendar.MONTH);
		System.out.println(month+1);
		
		int date = cal1.get(Calendar.DATE);
		System.out.println(date);
		
		int hour = cal1.get(Calendar.HOUR);
		System.out.println(hour);
		
		int min = cal1.get(Calendar.MINUTE);
		System.out.println(min);
		
		int sec = cal1.get(Calendar.SECOND);
		System.out.println(sec);
	}
}
